package com.hzau.tourist_service_sys.comtroller;

import com.hzau.tourist_service_sys.pojo.ScenicSpot.ScenicSpot;
import com.hzau.tourist_service_sys.pojo.Weather.Way;
import com.hzau.tourist_service_sys.pojo.Weather.Weather;
import com.hzau.tourist_service_sys.result.Result;
import com.hzau.tourist_service_sys.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

@RestController
public class WeatherController {
    @Autowired
    WeatherService weatherService;

    @GetMapping("/weather/selectAllWeather/{pagenum}")
    public Result selectAllWeather(@PathVariable int pagenum){
        return weatherService.selectAllWeather(pagenum);
    }
    @GetMapping("/weather/selectWeatherDetail/{spotId}")
    public Result selectWeatherDetail(@PathVariable int spotId){
        return weatherService.selectWeatherDetail(spotId);
    }
    @PostMapping("/weather/queryWeather")
    public Result queryWeather(@RequestBody ScenicSpot scenicSpot){
        return  weatherService.queryWeather(scenicSpot);
    }
    @GetMapping("/traffic/selectAllConditons/{pagenum}")
    public Result selectAllConditons(@PathVariable int pagenum){
        return  weatherService.selectAllConditons(pagenum);
    }
    @PostMapping("traffic/queryCondtions")
    public Result queryCondtions(@RequestBody  Way way){
        return weatherService.queryCondtions(way);
    }
}
